package com.zx.mes.weather.hyl.feign;

import com.zx.mes.weather.hyl.entity.WeatherResponse;
import com.zx.mes.weather.hyl.feign.impl.WeatherDataFeignClientFallbackFactory;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 项目yun-data-weather WeatherDataController feign
 * @author hyl
 * @date 2018-3-6
 */
@FeignClient(name = "yun-data-weather",fallbackFactory = WeatherDataFeignClientFallbackFactory.class)
public interface WeatherDataFeignClient {
    /**
     * 获取城市的天气资源 例如:昆山
     * @param cityName
     * @return WeatherResponse
     */
    @GetMapping("/weather/cityName/{cityName}")
    WeatherResponse getWeatherDataByCityName(@RequestParam("cityName") @PathVariable("cityName") String cityName);
}

